package com.paireach.bw.utils;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

import es.dmoral.toasty.Toasty;


public class ToastyUtil {

    private static Toast toast;

    public static void showInfo(Context context, String text) {
        if (toast == null) {
            toast = Toasty.info(context, text);
        }
        toast.setText(text);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    public static void showWaring(Context context, String text) {
        if (toast == null) {
            toast = Toasty.warning(context, text);
        }
        toast.setText(text);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }

    public static void showError(Context context, String text) {
        if (toast == null) {
            toast = Toasty.error(context, text);
        }
        toast.setText(text);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }


}
